<!--
 * @Description: 流程分类
 * @Author: zhailei
 * @Date: 2021-01-18 15:17:31
 * @LastEditTime: 2021-09-09 16:58:02
 * 
 * @FilePath: \vite-demoe:\wwwroot\Vue\\-cloud-vue\src\pages\workflow\workflowCategory\index.vue
-->
<template>
  <div class="page-common-layout">
    <div class="page-common-content">
      <tool-bar
        @search="$refs.table.refresh(true)"
        @reset="
          () => {
            (this.queryParam = {}), $refs.table.refresh(true);
          }
        "
      >
        <template slot="toolBtn" slot-scope="scope">
          <a-button
            class="cu-btn-primary"
            icon="plus"
            @click="handleAdd()"
            v-action:workflowCategoryAddDialog
            >{{ $ct("add", "新增") }}</a-button
          >
          <!-- <a-button
          class="cu-btn-default"
          icon="edit"
          @click="handleEdit($refs.table.rows)"
          v-action:workflowCategoryEditDialog
          >编辑</a-button
        > -->
        </template>
        <template slot="toolForm">
          <a-form-item :label="$ct('categoryName', '分类名')">
            <a-input
              v-model="queryParam.categoryName"
              :placeholder="$ct('categoryName', '分类名')"
            />
          </a-form-item>
        </template>
      </tool-bar>
      <DataGrid
        ref="table"
        :columns="columns"
        :url="url"
        :queryParam="queryParam"
        rowKey="uuid"
        showPagination="auto"
        :showRowSelect="false"
      >
        <span slot="renderAction" slot-scope="{ text, record }">
          <template>
            <a @click="handleEdit(record)">{{ $ct("edit", "编辑") }}</a>
            <span class="action-margin"></span>
            <a @click="handleSub(record)" class="action-delete">{{
              $ct("delete", "删除")
            }}</a>
          </template>
        </span>
      </DataGrid>
      <edit-form
        ref="createModal"
        :visible="visible"
        :loading="confirmLoading"
        :model="mdl"
        @cancel="handleCancel()"
        @ok="handleOk()"
      />
    </div>
  </div>
</template>

<script>
import { dataGridMixin } from "@/mixins/dataGridMixin";
import { DataGrid } from "@/components";

import editForm from "./add.vue";

export default {
  name: "TableList",
  mixins: [dataGridMixin],
  components: { DataGrid, editForm },
  data() {
    return {
      columns: [
        {
          title: "分类名称",
          dataIndex: "categoryName",
        },
        {
          title: "分类标识",
          dataIndex: "categoryCode",
          langCode: "ClassificationIdentification",
        },
        {
          title: "创建时间",
          dataIndex: "createTime",
        },
        {
          title: "操作",
          dataIndex: "action",
          width: 120,
          align: "center",
          scopedSlots: { customRender: "renderAction" },
          fixed: "right",
        },
      ],
      visible: false,
      confirmLoading: false,
      mdl: null,
      // 查询参数
      queryParam: {},
      url: {
        getPageSet: "/workflow/flowCategory/getPageSet",
        deleteBatch: "/workflow/flowCategory/deleteBatch",
        update: "/workflow/flowCategory/update",
        save: "/workflow/flowCategory/save",
      },
    };
  },
};
</script>

<style lang="less"></style>
